#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tornado.web import RequestHandler
import pymongo
import re
import render
import codecs
import csv
from _base import BaseHandler
import datetime
import sys
sys.path.insert(0,'/home/leeray/workspaces/Python/wanalytics/')
sys.path.insert(0,'/opt/web/')
from Tools import getPid
from Tools import connectMySQL 
import json
from util import cache, settings
import _clientCache as clientcache
import logging


class GetCsvs(BaseHandler):    
    
    def post(self):        
	_data=self.get_argument("csv_text")
	self.set_header("Content-Type", "text/csv;charset=UTF-8")
	self.set_header("Content-Disposition", "attachment;filename=Report.csv;charset=UTF-8")
	_data = _data.encode('gb2312','ignore') 
	self.write(_data)
        self.finish()




